<template>
    <div>
        <p>{{a}}</p>
        <button @click="a++">+1</button>
    </div>
</template>

<script>
    import {reactive, ref, watch, watchEffect} from 'vue'
    export default {
        name: 'App',
        components:{},
        setup(){
            let a = ref(0);
            let person = reactive({
                name: 'wo'
            })
            watch(a,(newValue,oldValue)=>{
                console.log(newValue,oldValue);
            },{immediate:true,deep:true});

            watchEffect(()=>{
                const x = a.value;
                console.log(x)
            })
            return{
                a
            }
        }
    }
</script>

<style>

</style>